<?php
#
# author: Cody Sorgenfrey
# (c)2012 South Hill Calvary Chapel
#

include_once("../mysql/database_info.php");
include_once("common.php");
include_once("../mysql/common.php");

$title = "Donate"; 
$meta_key= 'give, tithe, donate, offering, money, paypal';
$meta_desc= "Donate to South Hill Calvary Chapel.";
$morehtml= "<style>input[type=radio]{margin-left: 15px;}li{font-size:12px;}</style>";
$morejava= "<script type='text/javascript'>window.onload = function() {calculatePreviewFee(); calculateFee();}</script>";

startPage($title, $meta_key, $meta_desc, $morehtml, $morejava);
?>
<p>
We live by the principle that where God guides...God provides. We don't ever want anyone to feel obligated to give money to our church. If you are a guest, we would desire that you would sit back and let the Lord and His Word minister to your heart. If you count South Hill Calvary Chapel as your home church, the Scripture teaches that the responsibility to financially support the work is yours...before the Lord. Our tithes and offerings should always be given as an act of worship unto the Lord, 2 Corinthians 9:6-7.<br><br>

If you would like to give to the Lord through the ministry of South Hill Calvary Chapel, tithes and offerings can be given within the sanctuary, by mail, or online. When you give online you can use a credit card, debit card, or PayPal account.<br><br>

Thank you for supporting the ministry at South Hill Calvary Chapel.<br><br>

When you click donate below, you will be redirected to a PayPal hosted site in which you can choose your payment method.
</p>
<br>
<div class='paragraph' align='left'>
		<form action="https://www.paypal.com/cgi-bin/webscr" method="get" style="">
		<input type="hidden" id="command" name="cmd" value="_xclick-subscriptions">
		<input type="hidden" name="business" value="ZA3X5L9YSBD8J">
		<input type="hidden" name="lc" value="US">
		<input type="hidden" id="itemName" name="item_name" value="Recurring Donation">
		<input type="hidden" name="item_number" value="0">
		<input type="hidden" name="no_note" value="1">
		<input type="hidden" name="no_shipping" value="2">
		<input type="hidden" name="rm" value="1">
		<input type="hidden" name="return" value="http://www.southhillcalvary.org">
		<input type="hidden" name="cancel_return" value="http://www.southhillcalvary.org">
		<input type="hidden" name="src" value="1">
		<input type="hidden" name="p3" value="1">
		<input type="hidden" name="currency_code" value="USD">
		<input type="hidden" name="page_style" value="SHCC">
		<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted">
		<p>What is this donation for?</p>
		<input type="radio" name="tier2" value="SHCC General" checked="true" onclick="changePurpose(this.value); document.getElementById('moreOptions').style.display='none';"><span style="font-size:12px;">General Donation</span><br>
		<input type="radio" name="tier2" value="SHCC General" onclick="document.getElementById('moreOptions').style.display='block';"><span style="font-size:12px;">More options...</span><br>
			<ul id="moreOptions" style="list-style-type:none;display:none;">
				<li><input type="radio"  name="tier2" value="SHCC Missions" onclick="submenu('missions');changePurpose(this.value);">Missions</li>
					<ul class="subMenu" id="missions" style="list-style-type:none;display:none;">
					<?
					connect_select_test("missionaries");
					$missionaries = mysql_query("SELECT * FROM `missionaries` ORDER BY `first` ASC");
					while ($missionary = mysql_fetch_array($missionaries)){
						if (!empty($missionary['donationName'])){
							printf("<li><input type='radio'  name='tier2' value='SHCC %s' onclick='changePurpose(this.value);'>%s</li>\n", $missionary['donationName'], $missionary['donationName']);
						}
					}
					?>
					</ul>
				<li><input type="radio"  name="tier2" value="SHCC Other" onclick="this.nextSibling.disabled=false; changePurpose(this.value); submenu('');"><input type="text" id="customPurpose" onkeyup="changePurpose(('SHCC '+this.value)); this.previousSibling.value=('SHCC '+this.value);" placeholder="Other" disabled="true"></li>	
			</ul>
		<p>How many times would you like this to recur? (including this payment)</p>
		<select id="times" name="srt" onchange="checkForOneTime()">
			<option value="0">Never End</option>
			<option value="1">This Time Only</option>
			<option value="2">2</option>
			<option value="3">3</option>
			<option value="4">4</option>
			<option value="5">5</option>
			<option value="6">6</option>
			<option value="7">7</option>
			<option value="8">8</option>
			<option value="9">9</option>
			<option value="10">10</option>
			<option value="11">11</option>
			<option value="12">12</option>
		</select>
		<br>
		<span id="recurring">
			<p>When would you like this to Recur?</p>
			<select id="when" name="t3">
				<option value="W">Weekly</option>
				<option value="M" selected="selected">Monthly</option>
				<option value="Y">Yearly</option>
			</select>
			<br>
		</span>
		<p>Enter Your Donation Amount:</p>
		<p>$<input id="cash" type="number" name="textField" maxlength="200" onkeyup="calculatePreviewFee()" value="0.00">
		&nbsp;<input type="checkbox" name="addFee" id="addFee" onclick="calculateFee()"> Cover paypal fee ($<span id="preview">0.30</span>).</p> 
		<p>$<span id="donation">0.00</span> donation
		<br>
		$<span id="feeCovered">0.00</span> extra to cover fee</p>
		<hr width="75px" align="left">
		<p>$<span id="total" >0.00</span> total</p>
		<br>
		<input type="hidden" id="finalTotal" maxlength="200" name="a3" value="0.00">
		<input type="image" src="/images/Donate.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" onclick="getTotalDonation()">
		<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
		</form>	
	</div>
<?
endPage();
?>